using System;
using System.Runtime.Serialization;

namespace Dotss.Core
{

	[Serializable]
	public class SessionArgs
	{

		#region Fields

		private readonly string _MachineName;
		private readonly string _ApplicationName;
		private readonly string _EnvironmentName;
		private readonly string _SessionID;
	    private readonly int _LockID;
		private readonly int _Timeout;

		#endregion

		public SessionArgs(string machineName, string applicationName, string environmentName, string sessionId, object lockId, int timeout)
		{
			_MachineName		= machineName;
			_ApplicationName	= applicationName;
			_EnvironmentName	= environmentName;
			_SessionID			= sessionId;
			_Timeout			= timeout;

		    int testInt;
            if (lockId != null && int.TryParse(lockId.ToString(), out testInt)) _LockID = testInt;
			else _LockID = 0;

		}

		#region Properties
		
		public string MachineName		{ get { return _MachineName; }}
		public string ApplicationName	{ get { return _ApplicationName; }}
		public string EnvironmentName	{ get { return _EnvironmentName; }}
		public string SessionID			{ get { return _SessionID; }}
		public int TimeoutMins			{ get { return _Timeout; }}
		public int LockID				{ get { return _LockID; }}

		#endregion	
	
	}
}